<template>
  <div class="footer-nav">
    <div v-for="(r, key) in navs[$route.meta.title]" :key="key" class="item-nav" @click="skip(r)">
      {{ r.title }}
    </div>
  </div>
</template>

<script>
const ZBFW = `http://223.4.71.126:8098/zjzb_api/auth/avoidLogin?projectCode=lBpUqx&sign=b7edb343e0ab5c0a6bb6d22f4d6764e5f050f9628ceb6b9dbd358926866c09debac48c5226c0e1b075cfeba66318e9352086fa6bbf7420eae8e3846be12cb1bb8a5c1f8c6487f47b0d893b392e26da1e43a9a98fd4dd8aa26a2c8b20eb0206dcbc3fc313f95686854b1ab0236352f06f75fe8052180026549504ec9f9af83750754296bbfc30fa0e`;
export default {
  data() {
    return {
      navs: {
        种好粮食一件事: [
          { name: "PlantsManage", title: "种植管理" }, // 先禁用 PlantsManage
          { name: "FarmingServe", title: "农事服务" }, // 先禁用 FarmingServe
          { name: "Farmingpolicy", title: "惠农政策" }, // 先禁用 Farmingpolicy
        ],
        种植管理: [
          { name: "", title: "种植主体" },
          { name: "", title: "农田管理" },
          { name: "", title: "生产管理" },
        ],
        农事服务: [
          // { name: "", title: "种子服务" },
          { name: "", title: "技术服务" }, 
          { name: "", title: "农机服务" },
          { name: "", title: "植保服务" },
          { name: "", title: "耕肥服务" },
          { name: "", title: "防灾减灾" },
        ],
        惠农政策: [
          { name: "", title: "种粮补贴" },
          { name: "", title: "政策信息" },
          { name: "", title: "金融服务" },
        ],
      },
    };
  },
  methods: {
    skip({ name, title }) {
      if (title === "植保服务") return window.open(ZBFW);
      this.$router.push({ name });
    },
  },
};
</script>

<style scoped lang="less">
.footer-nav {
  display: flex;
  position: absolute;
  bottom: 50px;
  left: 50%;
  z-index: 999;
  transform: translateX(-50%);
  .item-nav {
    background: url("~@/assets/imgs/nav-bg.webp") no-repeat;
    width: 100px;
    height: 100px;
    line-height: 100px;
    text-align: center;
    background-size: contain;
    cursor: pointer;
    margin: 0 20px;
    color: #fff;
    transition: all 0.1s;
    &:hover {
      transform: scale(1.1);
    }
  }
}
</style>
